package com.alex.designPattern.strategy;

import com.alex.designPattern.AbstractDao;

/**
 * @author alex
 *
 */
public class StrategyReflection {
	
	private AbstractDao dao;
	
	public StrategyReflection(String className) throws Exception{
		try {
			this.dao = (AbstractDao)Class.forName(className).newInstance();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}
	
	public Object getObject(){
		return dao.getById();
	}
}
